Scenario #9110: Fetch Current Login User

UseCase Current Login User => Current Login User

Fetches data about the current login user.

Properties

Given

name value
subjectName hsh-fran_superuser
personGivenName Fran
expectedToBeGlobalAdmin true

Person: Fran

HTTP GET "/api/hs/office/persons?name=Fran" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "91c72d5c-2956-43dd-8f07-1bf427347bc0",
  "personType" : "NATURAL_PERSON",
  "tradeName" : null,
  "salutation" : null,
  "title" : null,
  "givenName" : "Fran",
  "familyName" : "Hostmaster"
} ]

In production, data this query could result in multiple outputs. In that case, you have to find out which is the right one.

Current Login User

HTTP GET "/api/hs/accounts/current" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-fran_superuser>"` \
  `# }`
=> status: 200 OK 
{
  "subject" : {
    "uuid" : "8fb32bb1-4696-534f-93d1-b03df461d689",
    "name" : "hsh-fran_superuser",
    "type" : "USER"
  },
  "person" : {
    "uuid" : "91c72d5c-2956-43dd-8f07-1bf427347bc0", // Person: Fran
    "personType" : "NATURAL_PERSON",
    "tradeName" : null,
    "salutation" : null,
    "title" : null,
    "givenName" : "Fran",
    "familyName" : "Hostmaster"
  },
  "globalAdmin" : true
}

generated on 2026-07-17 01:42:18 for branch